package com.gosophia.smsReceive.action;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.smsReceive.dto.SmsReceiveDTO;
import com.gosophia.smsReceive.ws.SmsReceiveWebService;

/**
 * 短信列表处理
 * 
 * @author tianchunyu
 */
@Controller("SetSmsFlagAction")
@Scope("prototype")
public class SetSmsFlagAction extends BaseSupportAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private static final Log logger = LogFactory
			.getLog(SetSmsFlagAction.class);

	private Long id;
	private boolean flg;

	@Autowired
	private SmsReceiveWebService smsReceiveWebService;

	@Override
	public String _execute() throws Exception {
		SmsReceiveDTO smsDto = smsReceiveWebService.setSmsFlg(id, flg);
		logger.debug("修改了id为"+smsDto.getSmsReceiveId() +"的标志位为"+smsDto.isFlg()+"。");
		return SUCCESS;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public boolean isFlg() {
		return flg;
	}

	public void setFlg(boolean flg) {
		this.flg = flg;
	}
	
}
